/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.factory.simpleFactory.enhance;

import com.aeky.factory.baseData.product.Pizza;
import com.aeky.factory.baseData.product.PizzaA;
import com.aeky.factory.baseData.product.PizzaB;
import com.aeky.factory.baseData.product.PizzaC;

/**
 * 简单工厂类
 * 
 * @author aeky
 */
public class SimplePizzaFactory {

    /**
     * 提供一个静态的方法产生对象
     * 
     * @param type
     * @return Pizza
     */
    public static Pizza createPizza(String type) {
        Pizza pizza = null;
        if ("pizzaA".equals(type)) {
            pizza = new PizzaA();// 创建pizzaA
        } else if ("pizzaB".equals(type)) {
            pizza = new PizzaB();// 创建pizzaB
        } else if ("pizzaC".equals(type)) {
            pizza = new PizzaC();// 创建pizzaC
        }
        return pizza;
    }
}
